<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增试题</title>
<script type="text/javascript" src="<%=request.getContextPath()%>/static/common/plugin/jquery.min.js"></script>
<script type="text/javascript" src = "<%=request.getContextPath() %>/static/teach/js/record-list.js"></script>
<link href="<%=request.getContextPath()%>/static/sys/user-manager/css/userList.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<center><h2>新增试题</h2></center>
		<hr>
		<form action="<%=request.getContextPath()%>/teach/testquestion/QuestionServlet?command=add" method="post" onsubmit="return validate();">
    	   题　　目:<input type="text" name="question" id="question" onkeyup="checkLength(this)" onblur="upperCase(this)"/><br><br>
       	   附　　件:<input type="file" name="attachment" size="50"><br><br>
       	   所属课程:<select name="courseName"> 
				<option value="">—全部课程—</option>
                <c:forEach items="${nameList }" var="nameList" >               
				<option  value="${nameList.courseName  }">　${nameList.courseName  }　</option>
				<span id="courseName"></span>
			</c:forEach>  
			</select><br><br>
       	   题　　型:<input type="radio" name="question_type" id="dan" value="1"/>单选
	            <input type="radio" name="question_type" id="duo" value="2"/>多选
	            <input type="radio" name="question_type" id="pan" value="3"/>判断 <br><br>
	     <div id="choiceAnswer">
	             选 项 A :<input type="text" name="answer_a" id="answer_a"/>
	             选 项 B :<input type="text" name="answer_b" id="answer_b"/>
	             选 项 C :<input type="text" name="answer_c" id="answer_c"/>
	             选 项 D :<input type="text" name="answer_d" id="answer_d"/>
	     </div><br>
	             答　　案:<input type="text" name="answer" id="answer" /><br><br>
	  	   难　　度:
	            <input type="radio" name="difficulty" value="1"  />低
	            <input type="radio" name="difficulty" value="2"  />中
	            <input type="radio" name="difficulty" value="3"  />较高
	            <input type="radio" name="difficulty" value="4"  />高 <br><br>
	             分　　析:<input type="text" name="analysis" id="analysis" /><br><br>
	             关  键  词:<input type="text" name="keywords" id="keywords" /><br><br>       
       	   备　　注:<input type="text" name="memo" id="memo"/><br>
          <span id="nameInfo"></span><br><br>
        <input type="submit" value="新增" onclick="return confirm('是否新增？');">
     </form>
<script type="text/javascript">
	function checkLength(which) {
	    var oTextCount = document.getElementById("char");   
	    iCount = which.value.replace(/[^\u0000-\u00ff]/g,"aa");
	    which.style.border = '1px dotted #FF0000';
		which.size=iCount.length+2;
}
	$("#choiceAnswer").hide(); // 先隐藏第二组文本框
	$("#dan").click(function() {
	    $("#choiceAnswer").show(); // 然后显示对应的文本框
	});
	$("#duo").click(function() {
	    $("#choiceAnswer").show(); // 然后显示对应的文本框
	});
	$("#pan").click(function() {
	    $("#choiceAnswer").hide(); // 隐藏选项
	});
</script>
</body>
</html>